package com.example.demo.exception;

/**
 * 业务异常
 */
public final class BusinessException extends RuntimeException {

    private String code;

    private Object data;

    private String message;

    public BusinessException(String code, Object data, String message) {
        this.code = code;
        this.data = data;
        this.message = message;
    }

    public BusinessException(String code) {
        this.code = code;
    }

    public BusinessException(String code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

}
